home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 30
/
Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso
/
Aminet
/
comm
/
irc
/
Online-O-Meter.lha
/
O-O-Meter.amirx
next >
Wrap
Text File
|
1999-02-21
|
2KB
|
28 lines
/*
Online-O-Meter Version 1.01
Compilation Date: 21-Feb-1999.
© 1999 Frank Meyer-Pfauder.
*/
file="Programs:Net/Dial/DialLog.txt"
ADDRESS(AMIRC.1);CALL output("Online-O-Meter - Retrieving online data...");IF ~EXISTS(file) THEN DO
CALL output("Oh no... specified Miami log file could not be found.");EXIT;END;prevline="";actline=""
IF OPEN(log,file,'R') THEN DO;DO WHILE ~EOF(log);prevline=actline;actline=readln(log)
IF FIND(actline,'Online:')>0 THEN lastonline=actline;END;CLOSE(log);END;ELSE DO
CALL output("Arrgh... log file could not be opened... maybe read protected ?");EXIT;END
IF FIND(prevline,'Online:')>0 | FIND(prevline,'Reconnect:')>0 THEN DO
IF FIND(prevline,'Reconnect:')>0 THEN prevline=lastonline;logtime=subword(prevline,3,1)
ologday=subword(prevline,2,1);logday=substr(ologday,7,4)||substr(ologday,4,2)||substr(ologday,1,2)
day=date('W',logday,'S')
CALL output("You have been online since "substr(logtime,1,5)" h, "day" "ologday".")
logtot=date('B',logday,'S')+(convsecs(logtime)/86400);actdate=date('S');acttime=time('N')
acttot=date('B',date('S'),'S')+(convsecs(acttime)/86400);ontime=(acttot-logtot)
ondays=(substr(ontime,1,pos('.',ontime)-1));onhours=(substr(ontime,pos('.',ontime)))*24
onmins=(substr(onhours,pos('.',onhours)))*60;onhours=(substr(onhours,1,pos('.',onhours)-1))
onmins=(substr(onmins,1,pos('.',onmins)-1))
CALL output(d2c(2)"You have been online for "ondays" day(s), "onhours" hour(s) and "onmins" minute(s).")
END;ELSE DO;CALL output("Sorry... you don't seem to be online right now...");EXIT;END;EXIT;output:
parse arg text;"echo C=1 P="d2c(27)"b«O-O-Meter» "text;RETURN;convsecs:;parse arg otime
hour=substr(otime,1,2);min=substr(otime,4,2);sec=substr(otime,7,2);min=(hour*60)+min;sec=(min*60)+sec
RETURN sec